package com.gitee.wsl.mathematics.geometry.d2


import com.gitee.wsl.mathematics.geometry.d2.line.Line
import com.gitee.wsl.mathematics.geometry.d2.line.ext.extendBy
import com.gitee.wsl.mathematics.geometry.d2.line.ext.extendTo
import com.gitee.wsl.mathematics.vector.vec2.Vec2f
import kotlin.test.*

class LineSegmentTest {

//    @Test
//    fun shouldRotateCorrectly() {
//        val line = Line(100.0, 100.0, 200.0, 200.0)
//        assertEquals(line.start, line.rotateBy(30.0, 0.0).start)
//        assertEquals(line.end, line.rotateBy(30.0, 1.0).end)
//    }
//
//    @Test
//    fun shouldExtendToLength() {
//        val line = Line(100.0, 100.0, 200.0, 200.0)
//        val extended = line.extendTo(100.0f)
//        assertEquals(100.0f, extended.length, 1E-5)
//        assertEquals(line.length + 10.0f, line.extendBy(10.0f).length, 1E-5)
//
//        assertEquals(line.start, line.extendBy(10.0f, 1.0).start)
//        assertEquals(line.end, line.extendBy(10.0f, 0.0).end)
//    }
//
//    @Test
//    fun shouldCalculateSimplePointAtLength() {
//        val line = Line(Vec2f(110.0, 150.0), Vec2f(210.0, 30.0))
//        assertEquals(Vec2f(113.2009219983224, 146.1588936020131), line.pointAtLength(5.0), 0.0001)
//        assertEquals(Vec2f(186.8221279597376, 57.81344644831489), line.pointAtLength(120.0), 0.0001)
//        assertEquals(Vec2f(206.027659949672, 34.76680806039363), line.pointAtLength(150.0), 0.0001)
//        assertEquals(line.start, line.pointAtLength(-500.0))
//        assertEquals(line.end, line.pointAtLength(500.0))
//    }
}